<?php
session_start();
$text=array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$texta=$text[rand('0','25')];
$textb=$text[rand('0','25')];
$textc=$text[rand('0','25')];
$textd=$text[rand('0','25')];
$texte=$text[rand('0','25')];

$texts=$texta.$textb.$textc.$textd.$texte;
$_SESSION['captcha_text2']=$texts;
$im = @ imagecreate ( 90 , 30 );//kép generálása
$background_color = imagecolorallocate ( $im , rand('0','255') , rand('0','255') , rand('0','255') );//háttérszín
$text_color = imagecolorallocate ( $im , rand('0','255') , rand('0','255') , rand('0','255') );//szöveg szín

imagettftext ( $im , 25 , 0 , 0 , 25 , $text_color , "ttf/ttf.ttf" , $texta );
imagettftext ( $im , 25 , 0 , 15 , 25 , $text_color , "ttf/ttf.ttf" , $textb );
imagettftext ( $im , 25 , 0 , 30 , 25 , $text_color , "ttf/ttf.ttf" , $textc);
imagettftext ( $im , 25 , 0 , 45 , 25 , $text_color , "ttf/ttf.ttf" , $textd );
imagettftext ( $im , 25 , 0 , 60 , 25 , $text_color , "ttf/ttf.ttf" , $texte );//méret szög xstart ystart szin ttf text
header ( "Content-Type: image/jpeg" );
imagepng ( $im );
imagedestroy ( $im ); 
?> 
